#include "PlatformProperty.h"
// 保存app自定义方控按键功能选项
//默认为mute
VENDOR_READ_WRITE_PROPERTY(VENDOR_FUNC_CUSTOM_KEY, CustomKeyType) {
    builder.area(VehicleArea::GLOBAL)
            .initValue([]() {
                return CustomKeyType::CUSTOM_KEY_TYPE_MUTE;
            },PersistType::DID)
            .withStatusBySignals([]([[maybe_unused]] const PropertyStatus &last) {
                VHALOG.d("halWithStatusBySignals VENDOR_FUNC_CUSTOM_KEY : usgmod[%d] carmod[%d] ",
                    toInt(SIGNAL.getVehModMngtGlbSafe1UsgModSts()),
                    toInt(SIGNAL.getVehModMngtGlbSafe1CarModSts1()));
                if (!SIGNAL.usgModeIs(sdb::UsgModSts1::UsgModAbdnd) && SIGNAL.carModeIs(sdb::CarModSts1::CarModNorm)){
                    VHALOG.d("halWithStatusBySignals VENDOR_FUNC_CUSTOM_KEY : Active ");
                    return PropertyStatus::Active;
                } else {
                    VHALOG.d("halWithStatusBySignals VENDOR_FUNC_CUSTOM_KEY : NotActive ");
                    return PropertyStatus::NotActive;
                }
            },SignalRX::VehModMngtGlbSafe1UsgModSts,SignalRX::VehModMngtGlbSafe1CarModSts1)
            .withValueBySignals(
                []([[maybe_unused]] const CustomKeyType last) {
                    return last;
                })
            .onSetProperty([this](const CustomKeyType& value) {
                VHALOG.d("HalOnSetProperty BCM_FUNC_CUSTOM_KEY : %d", value);
                setValue(toInt(VehicleArea::GLOBAL),value,true);
            });
}